#include "newsbrowser.h"
#include <QPushButton>
#include <QVBoxLayout>

newsbrowser::newsbrowser(QWidget *parent, Qt::WindowFlags wf)
     : QDialog(parent, wf | Qt::FramelessWindowHint)
{
    QTextEdit textEdit;// = new QTextEdit(this);
    textEdit.setReadOnly(true);
    QString string = setStr();
    textEdit.setText(string);
    QPushButton closeBr(tr("close"));
    QPushButton::connect(&closeBr, SIGNAL(clicked()), this, SLOT(close()));
    QAction* close = new QAction("Close", this);
    connect(close, SIGNAL(triggered()), this, SLOT(close()));

    QMenu *m = QSoftMenuBar::menuFor(this);
    m->addAction(close);
    setWindowTitle("News");
    resize(240,300);
    QVBoxLayout *l = new QVBoxLayout(this);
    l->addWidget(&textEdit);
    l->addWidget(&closeBr);
    setLayout(l);
   // setWindowState(Qt::WindowMaximized);
    show();
}

newsbrowser::~newsbrowser()
{
}

void newsbrowser::getStr(QString news)
{
    str = news;
}

QString newsbrowser::setStr()
{
    return str;
}
